home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3bmd5job.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  1.9 KB  |  93 lines

  1. /* 
  2.  *
  3.  * $Id: k3bmd5job.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16.  
  17. #ifndef _K3B_MD5_JOB_H_
  18. #define _K3B_MD5_JOB_H_
  19.  
  20. #include <k3bjob.h>
  21. #include <qcstring.h>
  22. #include "k3b_export.h"
  23.  
  24. namespace K3bDevice {
  25.   class Device;
  26. }
  27.  
  28. class K3bIso9660File;
  29.  
  30.  
  31. class LIBK3B_EXPORT K3bMd5Job : public K3bJob
  32. {
  33.   Q_OBJECT
  34.  
  35.  public:
  36.   K3bMd5Job( K3bJobHandler* jh , QObject* parent = 0, const char* name = 0 );
  37.   ~K3bMd5Job();
  38.  
  39.   QCString hexDigest();
  40.   QCString base64Digest();
  41.  
  42.  public slots:
  43.   void start();
  44.   void stop();
  45.   void cancel();
  46.  
  47.   // FIXME: read from QIODevice and thus add K3bFileSplitter support
  48.  
  49.   /**
  50.    * read from a file.
  51.    *
  52.    * Be aware that the K3bMd5Job uses K3bFileSplitter to read splitted
  53.    * images. In the future this will be changed with the introduction
  54.    * of a setIODevice method.
  55.    */
  56.   void setFile( const QString& filename );
  57.  
  58.   /**
  59.    * read from an iso9660 file
  60.    */
  61.   void setFile( const K3bIso9660File* );
  62.  
  63.   /**
  64.    * read from a device
  65.    * This should be used in combination with setMaxReadSize
  66.    */
  67.   void setDevice( K3bDevice::Device* dev );
  68.  
  69.   /**
  70.    * read from the opened file descriptor.
  71.    * One needs to set the max read length or call stop()
  72.    * to finish calculation.
  73.    */
  74.   void setFd( int fd );
  75.  
  76.   /**
  77.    * Set the maximum bytes to read.
  78.    */
  79.   void setMaxReadSize( unsigned long long );
  80.  
  81.  private slots:
  82.   void slotUpdate();
  83.  
  84.  private:
  85.   void setupFdNotifier();
  86.   void stopAll();
  87.  
  88.   class K3bMd5JobPrivate;
  89.   K3bMd5JobPrivate* d;
  90. };
  91.  
  92. #endif
  93.